package com.info.zhiduoduo.common.excelconverter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.info.zhiduoduo.common.constants.city.TaxCityEnum;

public class OpeningLocationConverter  implements Converter<Integer> {

    @Override
    public Class supportJavaTypeKey() {
        return null;
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return null;
    }

    @Override
    public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration)
            throws Exception {
        return null;
    }

    @Override
    public CellData convertToExcelData(Integer integer, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration)
            throws Exception {
        if (integer == null) {
            return new CellData("");
        } else {
            TaxCityEnum cityEnum = TaxCityEnum.findById(integer);
            return new CellData(cityEnum.name);
        }
    }
}

